<!DOCTYPE html>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Subir fichero</title>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="jquery.gdocsviewer.min.js"></script>
<link href="css/Style.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div id="content">
		<form action="trata-fichero" enctype="multipart/form-data"
			method="post">
			<h2>Seleccion de fichero</h2>
			Fichero: <input id="inputFichero" type="file" name="fichero" /></br> <input
				type="submit" value="Subir fichero" /> <br />
			<object id="blah" width="400" height="400" data="#"></object>


			<%
				out.print(request.getAttribute("mensaje") != null ? "<p>"
						+ request.getAttribute("mensaje") + "</p>" : "<br/>");
			%>

			<script type="text/javascript">
				function readURL(input) {
					if (input != null && input.files && input.files[0]
							&& input.files[0] != null) {
						var reader = new FileReader();

						reader.onload = function(e) {
							$('#blah').attr('data', e.target.result);
							
						}

						reader.readAsDataURL(input.files[0]);
					}
				}
				$(document).ready(function() {
					
					$("#inputFichero").change(function() {
						readURL(this);
					});
					
					
				});
				
				
			</script>



			<br /> <a href="index.jsp">Volver </a><br />
		</form>

		<object></object>




	</div>
</body>
</html>